//
//  Network.m
//  kismet-frontend
//
//  Created by L. Preston Sego III on 7/28/09.
//  Copyright 2009 Precognition Inc.. All rights reserved.
//

#import "Network.h"


@implementation Network

@synthesize discoveryID;
@synthesize bssid;

// from client

// from bssid
@synthesize channel;
@synthesize signal_dbm;
@synthesize max_signal_dbm;
@synthesize frezMhz;
@synthesize lastTimeSeen;
@synthesize type;
@synthesize manuf;

// from ssid
@synthesize ssid;
@synthesize packets;




- (NSDate*)convertToNormalTime:(int)uDate
{
    return [NSDate dateWithTimeIntervalSince1970:uDate];    
}


- (NSDictionary*)cache
{
	NSDictionary *cache;	
	
	cache = [NSDictionary dictionaryWithObjectsAndKeys:
             [NSString stringWithFormat:@"%@", discoveryID],              @"id",
             [self ssid],                                            @"ssid",
             [self bssid],                                           @"bssid", 
             [NSString stringWithFormat:@"%@", signal_dbm],          @"signal",
             [NSString stringWithFormat:@"%@", max_signal_dbm],          @"maxsignal",
             [NSString stringWithFormat:@"%@", channel],            @"channel",
             [NSString stringWithFormat:@"%@", frezMhz],            @"freqMhz",
             [NSString stringWithFormat:@"%@", packets],            @"packets",
             type,                                                   @"type",
             [NSString stringWithFormat:@"%@", lastTimeSeen],               @"lastseen",
             nil                                                     // SENTINEL
             ];
	
    _cache = cache;
	return _cache; 
}


@end
